<template>
    <div class="con">
        <div class="toutu">
            <img src="../assets/images/toutu3.png" alt>
            <div class="text">
                <p class="p1">
                    收款金额 (元)
                    <b>{{data.orderAmount}}</b>
                </p>
                <p class="p2">
                    到账金额
                    <b>{{data.actualAmount}}</b>
                </p>
                <p class="p3">{{data.statusText}}</p>
            </div>
        </div>

        <div class="info1">
            <dl>
                <dd>交易单号</dd>
                <dt>
                    <p>{{data.orderNo}}</p>
                </dt>
            </dl>
            <dl>
                <dd>交易时间</dd>
                <dt>
                    <p>{{data.createTime}}</p>
                </dt>
            </dl>
            <dl>
                <dd>收款方式</dd>
                <dt>
                    <p>信用卡收款</p>
                </dt>
            </dl>
            <dl>
                <dd>支付账户</dd>
                <dt>
                    <p>
                        <img  :src="data.deductLogoUrl" alt class="icon">
                        {{data.deductBankName}} ({{data.deductCardNo}})
                    </p>
                </dt>
            </dl>
            <dl>
                <dd>到账储蓄卡</dd>
                <dt>
                    <p>
                        <img  :src="data.repayLogoUrl" alt class="icon">
                        {{data.repayBankName}} ({{data.repayCardNo}})
                    </p>
                </dt>
            </dl>
        </div>
        <img src="../assets/images/tradedetail.png" alt style="width:100%">

          <div class="btn" @click="close()">
            <button>关闭</button>
        </div>
    </div>
</template>

<script>
export default {
    name: "tradeDetail",
    data() {
        return {
            data: {},
            timestamp: ""
        };
    },
    methods:{
        close(){
             this.$router.push({ name: "credit" });
        }
    },
    mounted() {
        this.timestamp = Date.parse(new Date());

        this.axios({
            method: "post",
            headers: { token: localStorage.getItem("token") },
            url: `${
                this.siteUrl
            }/app/transaction/getOrderById?appid=web.2019&format=json&timestamp=${
                this.timestamp
            }`,
            data: {
                orderNo: this.$route.params.orderNo,

                userId: localStorage.getItem("userId")
            }
        })
            .then(response => {
                console.log(response);
                if (response.data.success == 1) {
                    this.data = response.data.data;
                } else {
                    this.$toast(response.data.message);
                }
            })
            .catch(error => {
                console.log(error);
                this.$toast("连接服务器异常");
            });
    }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.con {
    width: 100%;
    min-height: 100vh;
    background: #f9f9f9;
}
.con .toutu {
    width: 100%;
    position: relative;
}
.con .toutu img {
    width: 100%;
}
.con .toutu .text {
    position: absolute;
    width: 100%;
    top: 0px;
    left: 0px;
}
.con .toutu .text p {
    color: #ffe3c2;
    font-weight: 200;
}
.con .toutu .text .p1 {
    position: absolute;
    left: 20px;
    top: 24px;
}

.con .toutu .text .p2 {
    position: absolute;
    left: 20px;
    top: 54px;
}
.con .toutu .text b {
    color: #fff;
    margin-left: 5px;
}
.con .toutu .text .p3 {
    position: absolute;
    right: 15px;
    top: 24px;
}
.con .info1 {
    width: 100%;
    background: #fff;
}

.con .info1 dl {
    height: 60px;
    border-bottom: 1px solid #ececec;
    width: 90%;
    margin-left: 5%;
}
.con .info1 dl:last-child {
    border: none;
}
.con .info1 dd {
    line-height: 60px;
    color: #2d3659;

    float: left;
}
.con .info1 dt {
    float: right;
    width: 200px;
    height: 60px;
    line-height: 60px;
    position: relative;
    text-align: right;
    color: #2d3659;
}
.con .info1 dt p {
    position: absolute;
    top: 0px;
    right: 0px;
}
.con .info1 p .icon {
    vertical-align: middle;
    width: 18px;
    height: 18px;
    margin-right: 5px;
}

.con .info1 dt img {
    margin-left: 30px;
}
.btn {
    width: 90%;
    height: 48px;
    line-height: 48px;
    background: #ffae4e;
    text-align: center;
    border-radius: 25px;
    box-shadow: 0px 10px 30px 0px #fbc27f;
    position: fixed;
    bottom: 40px;
    left: 5%;
}
.btn button {
    width: 100%;
    font-size: 17px;
    color: #fff;
    background: transparent;
}
</style>
